<template>
  <div>
    <h1>子组件</h1>
    <div>
      <a href="#" @click="apply()">收起</a>
      <h1>添加收藏：写短评</h1>
      <label> <input type="radio" name="want" v-model="to" value="想看"/>想看</label>
      <label> <input type="radio" name="want" v-model="to" value="看过"/>看过</label>
      <br>
      <span>简短评论</span><br />
      <input type="text" v-model="text"/>
      <button @click="fn()">保存</button>
    </div>
  </div>
</template>

<script>


export default {
  data() {
    return {
      to: "",
      text:"",
      is:false
    };
  },
  mounted() {},
  methods: {
    fn(){
      this.$emit("show",this.is,this.to,this.text)
      this.to="",
      this.text=""
    },
    apply(){
      this.$emit("not",this.is)
    }
  },
};
</script>
<style lang='less' scoped>
</style>